<?php

	$listDAO = GetListDAO();

	/*tag*/
	$hotTags = $listDAO->getHotTags();
	
   	/*summary*/
	global $t,$q,$s;

	require_once ( LIB_DIR.'classes/Pager.php' );
	
	if(!edp_is_empty_string($q)){		

		$q=edp_db_input($q);
	}
			
	$page='1';
	if(isset($_GET[UP_RESULT_PAGE])){
		$page=intval($_GET[UP_RESULT_PAGE]);
	} 
	
	
	switch($s){	    	
	   case '2':{	   	
	      $sortby = 'create_time';
	      break;
	   }	   
	   case '3':{	   	
	      $sortby = 'response_count';
	      break;
	   }	   
	   case '4':{	   	
	      $sortby = 'flower_count';
	      break;
	   }	   
	   case '5':{	   	
	      $sortby = 'contribution';
	      break;
	   }	   
	   default:{	 
	      $sortby = 'view_count';
	      break;   	 	
	   }		
	}
		
	$listArr = $listDAO->GetListBySortAndFilter($sortby,$t,$q,LIST_INFO_PER_PAGE,$page);
	
	$currentURL = htmlspecialchars( $_SERVER["REQUEST_URI"] );
	$currentURL = preg_replace( '/&p=[0-9]+/', "", $currentURL );
	
	$pageObj = new Pager($currentURL,$listArr['total_num'], LIST_INFO_PER_PAGE, $page, UP_RESULT_PAGE );
	
?>
